﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InterfaceStudy
{

    /// <summary>
    /// 支付接口
    /// 接口命名规范： 必须以"I"开头
    /// </summary>
    public interface IPay
    {
        /// <summary>
        /// 定义了一个规范
        /// 默认就是 public
        /// </summary>
        void Pay();

    }


    /// <summary>
    /// 支付宝支付类
    /// </summary>
    public class ZhiFuBaoPay : IPay
    {
        /// <summary>
        /// 实现IPay中的Pay()方法
        /// </summary>
        /// <exception cref="NotImplementedException"></exception>
        public void Pay()
        {
            Console.WriteLine("实现了支付宝支付");
        }
    }

    /// <summary>
    /// 微信支付类
    /// </summary>
    public class WechatPay : IPay
    {
        /// <summary>
        ///  实现IPay中的Pay()方法
        /// </summary>
        /// <exception cref="NotImplementedException"></exception>
        public void Pay()
        {
            Console.WriteLine("实现了微信支付");
        }
    }
}
